// 用户API路由
import express from 'express';
import { UserController } from './UserController.js';
import { authMiddleware } from '../../middleware/authMiddleware.js';
import { userAuthMiddleware } from '../../middleware/userAuthMiddleware.js';

const router = express.Router();

// 用户注册
router.post('/register', UserController.register);

// 用户登录  
router.post('/login', UserController.login);

// 用户登出
router.post('/logout', authMiddleware, userAuthMiddleware, UserController.logout);

// 获取用户个人信息
router.get('/profile', authMiddleware, userAuthMiddleware, UserController.getProfile);

// 更新用户个人信息
router.put('/profile', authMiddleware, userAuthMiddleware, UserController.updateProfile);

// 用户修改密码
router.put('/change-password', authMiddleware, userAuthMiddleware, UserController.changePassword);

export default router; 